import { ElNotification, ElMessage, ElMessageBox } from 'element-plus'
import nprogress from 'nprogress'

// 消息提示
export function toast(msg, type = 'success', dangerouslyUseHTMLString = false) {
  ElNotification({
    message: msg,
    type: type,
    dangerouslyUseHTMLString: dangerouslyUseHTMLString,
    duration: 3000
  })
}

export function showModel(content = '提示类型', type = 'warning', title = '') {
  return ElMessageBox.confirm(content, title, {
    confirmButtonText: '确认',
    cancelButtonText: '取消',
    type: type
  })
}

// 显示全屏loading
export function showFullLoading() {
  nprogress.start()
}

// 隐藏全部loading
export function hideFullLoading() {
  nprogress.done()
}
